#ifndef IMAGEANNENTRY_H
#define IMAGEANNENTRY_H

#include "imageannitem.h"

using cv::Scalar;

// 标注条目，包含很多标注项
class ImageAnnEntry
{
public:
    void clear()
    {
        itemCounts = 0;
        imageItems.clear();
    }

    // 重载==运算符
    bool operator==(const ImageAnnEntry &rhs)
    {
        return rhs.getEntryName() == this->entryName;
    }

    void addItem(const ImageAnnItem &_item)
    {
        imageItems.push_back(_item);
    }

    void setColor(const Scalar &_color)
    {
        color = _color;
    }

    void setEntryName(const string &_name)
    {
        entryName = _name;
    }

    void setImageItems(const vector<ImageAnnItem> &_items)
    {
        imageItems = _items;
    }

    void setItemCounts(int _counts)
    {
        itemCounts = _counts;
    }

    string getEntryName()
    {
        return entryName;
    }

    const string getEntryName() const
    {
        return entryName;
    }

    vector<ImageAnnItem>& getImageItems()
    {
        return imageItems;
    }

    Scalar getColor()
    {
        return color;
    }

    int getItemCounts()
    {
        return itemCounts;
    }

private:
    // 当前标注条目里面的标注项
    vector<ImageAnnItem> imageItems;
    // 标注项数量
    int itemCounts = 0;
    // 标注条目名称
    string entryName;
    // 颜色
    Scalar color;
};


#endif // IMAGEANNENTRY_H
